const Router = require("koa-router");
const router = new Router({ prefix: "/bl-common" });
const {
  queryEnumType,
  queryDictControl,
  queryDictByIdControl,
  queryNavTypeControl,
  queryNavListControl,
  queryFriendLinkControl,
  queryHotControl,
  modifyFriendLinkByIdControl,
  modifyNavByIdControl,
  addFriendLinkControl,
  addNavControl,
  queryLimitControl,
  addLimitControl,
  modifyControl,
  deleteLimitControl
} = require("../controller/commonController");
const {
  verifyEnumType,
  verifyDictParams,
} = require("../middlewares/common.middle");
router.post("/common", verifyEnumType, queryEnumType);
router.post("/querydict", verifyDictParams, queryDictControl);
router.post("/queryDictById", queryDictByIdControl);

// 导航
router.post("/queryNavList", queryNavListControl);
router.post("/queryNavType", queryNavTypeControl);
router.post("/modifyNavById", modifyNavByIdControl);
router.post("/addNav", addNavControl);
// 友情链接
router.post("/queryFriendLink", queryFriendLinkControl);
router.post("/modifyFriendLinkById", modifyFriendLinkByIdControl);
router.post("/addFriendLink", addFriendLinkControl);

// 热搜
router.get("/hot", queryHotControl);

// 权限管理
router.get("/queryLimit", queryLimitControl);
router.post("/addLimit", addLimitControl);
router.post("/modifyLimit", modifyControl);
router.post("/deleteLimit", deleteLimitControl); 

module.exports = router;
